<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
		<script type="text/javascript">
			$(function(){//ready函数网页加载完毕后执行
				$("#num2").bind("change",function(){  //事件绑定
					let n1 = $("#num1").val()-0   //获取值
					let n2 = $("#num2").prop("value")-0  //通过对象的属性来获取值
					let sum = n1 + n2
					$(":disabled").val(sum.toFixed(14)-0) //写入值
				})
			})
		</script>
	</head>
	<body>
		<input type="text" id="num1" placeholder="第一个数">+
		<input type="text" id="num2" placeholder="第二个数">=
		<input type="text" id="num3" placeholder="计算结果" disabled="disabled">
	</body>
</html>
